package wql.aaa.service.impl;

import com.aaa.entity.TbArticle;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import wql.aaa.service.TbArticleService;
import wql.aaa.dao.TbArticleMapper;
import org.springframework.stereotype.Service;

/**
* @author 咕噜咕噜
* @description 针对表【tb_article】的数据库操作Service实现
* @createDate 2023-03-01 11:33:16
*/
@Service
public class TbArticleServiceImpl extends ServiceImpl<TbArticleMapper, TbArticle>
    implements TbArticleService{

    @Autowired
    private TbArticleMapper tbArticleMapper;
    @Override
    public Result getArtical(String navId) {
        QueryWrapper<TbArticle> wrapper = new QueryWrapper<>();
        wrapper.eq("nav_id",navId );
        TbArticle tbArticle = tbArticleMapper.selectOne(wrapper);
        return new Result(2000,"成功",tbArticle);
    }

    @Override
    public Result updateArtical(TbArticle tbArticle) {
        tbArticleMapper.updateById(tbArticle);
        return new Result(2000,"修改成功");
    }
}




